Feat: Support basic Symbol navigation inside AI coding session#258
Feat: Support basic Symbol navigation inside AI coding session#258
Conversation
This reverts commit b205107.
There was a problem hiding this comment.
Pull request overview
Adds basic symbol linkification + navigation to AI session buffers, building on the existing in-repo file/URL link support so users can jump from agent output to relevant code locations more directly.
Changes:
- Linkify “symbol-like” tokens appearing near a resolved file link and make them clickable with dedicated keybindings.
- Add navigation commands to open the associated file link and then resolve the symbol via xref, helm-gtags, or buffer search.
- Extend
ai-code--explain-diredto include context for multiple selected files/directories.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
ai-code-session-link.el |
Adds symbol candidate detection, properties/keymap, and navigation commands integrated into session linkification. |
test/test_ai-code-session-link.el |
Adds ERT coverage for symbol linkification behavior and symbol navigation fallbacks. |
ai-code-discussion.el |
Updates Dired explain prompt generation to handle multiple selections and format multi-file context. |
| (let* ((file-at-point (dired-get-filename nil t)) | ||
| (git-relative-path (when file-at-point | ||
| (car (ai-code--get-git-relative-paths (list file-at-point))))) | ||
| (files-context-string (when git-relative-path | ||
| (concat "\nFiles:\n@" git-relative-path))) | ||
| (all-marked (dired-get-marked-files)) | ||
| (has-marked-files (> (length all-marked) 1)) | ||
| (context-files (if has-marked-files | ||
| all-marked | ||
| (when file-at-point | ||
| (list file-at-point)))) |
There was a problem hiding this comment.
dired-get-marked-files is now called unguarded. In Dired, this can signal an error when point is not on a file line (e.g., header/subdir lines), which would regress the previous behavior that handled nil from dired-get-filename gracefully. Consider wrapping the call in ignore-errors and/or using the existing “explicit marks” detection pattern used elsewhere (e.g., treat a single entry equal to file-at-point as ‘no explicit marks’) so the command doesn’t error and also supports a single explicitly-marked file.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03e1ed97c1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This is an improvement on top of existing file path & url navigation #249
It will try 1. LSP; 2. xref; 3. helm-gtags to navigate
Verified that both vterm and eat backends works.
screenshot: